﻿using SCM.Common;
using SqlSugar;
using System;

namespace SCM.Model.DBEntity
{
    /// <summary>
    /// 任务表
    /// </summary>
    [SugarTable("T_Task")]
    public class T_Task : EntityBase
    {
        /// <summary>
        /// 任务ID
        /// </summary>
        public string ID { get; set; }

        /// <summary>
        /// 任务编号
        /// </summary>
        public string TaskNo { get; set; }

        /// <summary>
        /// 发布任务企业ID
        /// </summary>
        public string PublisherCompanyID { get; set; }

        /// <summary>
        /// 接收任务企业ID
        /// </summary>
        public string SubscriberCompanyID { get; set; }

        /// <summary>
        /// 任务来源类型
        /// </summary>
        public TaskSourceTypeEnum TaskSourceType { get; set; }

        /// <summary>
        /// 任务来源类型
        /// </summary>
        [SugarColumn(IsIgnore = true)]
        public string TaskSourceTypeStr { get { return EnumHelper.GetDescription(TaskSourceType); } }

        /// <summary>
        /// 任务描述
        /// </summary>
        public string Description { get; set; }

        /// <summary>
        /// 发起用户ID
        /// </summary>
        public string PublisherUserID { get; set; }

        /// <summary>
        /// 发起日期
        /// </summary>
        public DateTime PublisherDate { get; set; }

        /// <summary>
        /// 发起日期
        /// </summary>
        [SugarColumn(IsIgnore = true)]
        public string PublisherDateStr { get { return PublisherDate.ToString("yyyy-MM-dd HH:mm:ss"); } }

        /// <summary>
        /// 任务类别
        /// </summary>
        public TaskCategoryEnum TaskCategory { get; set; }

        /// <summary>
        /// 任务类别
        /// </summary>
        [SugarColumn(IsIgnore = true)]
        public string TaskCategoryStr { get { return EnumHelper.GetDescription(TaskCategory); } }

        /// <summary>
        /// 任务状态
        /// </summary>
        public TaskStatusEnum TaskStatus { get; set; }

        /// <summary>
        /// 任务状态
        /// </summary>
        [SugarColumn(IsIgnore = true)]
        public string TaskStatusStr { get { return EnumHelper.GetDescription(TaskStatus); } }

        /// <summary>
        /// 任务执行人
        /// </summary>
        public string SubscriberUserID { get; set; }

        /// <summary>
        /// 任务执行时间
        /// </summary>
        public DateTime SubscriberDate { get; set; }

        /// <summary>
        /// 任务执行时间
        /// </summary>
        [SugarColumn(IsIgnore = true)]
        public string SubscriberDateStr { get { return SubscriberDate.ToString("yyyy-MM-dd HH:mm:ss"); } }
    }
}